import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class P58_1 {
	public static void main(String[] args) {
		int[][] cm = null;
		
		for (int n = 2; true; n++) {
			
			int size = (2 * n - 1);
			int[][] m = new int[size][size];
			
			if (cm != null) {
				for (int i = 0; i < cm.length; i++) {
					for (int j = 0; j < cm.length; j++) {
						m[i + 1][j + 1] = cm[i][j];
					}
				}
			}

			cm = m;
			
			
			int x = size - 1;
			int y = size - 1;
			int num = size * size;
			
			while (true) {
				
				m[y][x] = num;
				
				num--;
				
				if (num == 0) {
					break;
				}
				
				if (x >= 1 && m[y][x - 1] == 0) {
					if (y < size - 1 && m[y + 1][x] == 0) {
						y++;
					} else {
						x--;
					}
				} else if (y >= 1 && m[y - 1][x] == 0) {
					y--;
				} else if (x < size - 1 && m[y][x + 1] == 0) {
					x++;
				} else if (y < size - 1 && m[y + 1][x] == 0) {
					y++;				
				} else {
					System.out.println("OK");
					break;
				}
			}
			
//			for (int i = 0; i < m[0].length; i++) {
//				for (int j = 0; j < m[i].length; j++) {
//					System.out.format("%02d ", m[i][j]);
//				}
//				System.out.println();
//			}
//			
//			System.out.println();
			
			Set<Integer> set = new HashSet<Integer>();
			Set<Integer> primeSet = new HashSet<Integer>();
			for (int i = 0; i < size; i++) {
				set.add(m[i][i]);
				set.add(m[size - i - 1][i]);
			}
			
			Iterator<Integer> iterator = set.iterator();
			while (iterator.hasNext()) {
				int i = iterator.next();
			//	System.out.print(i + ",");
				if (Util.isPrime(i)) {
					primeSet.add(i);
				}
			}
			//System.out.println();
			
			float ratio = (float)primeSet.size()/(float)set.size();
			System.out.println(size + ":" + ratio);
			
			if (ratio < 0.1) {
				System.out.println(size);
				return;
			}
		}
	}
}
